#!/bin/bash
# Sorts table of locations and seconds in reverse order and displays it with individual and cumulative percentages.
sum=$(cat "$1" | awk '{sum += $2} END { print sum }')
tac "$1" | awk '{perc_local=$2 / '"$sum"' * 100; perc += perc_local; print $1 " " $2 " " perc_local " " perc}'
